package com.onpositive.page.pagerendering;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.List;

import com.onpositive.storage.data.UnifiedContentHolder;

public class ShowResourceListRenderer {

	public final static String FIELD_WITH_CONTENT_NAME = "commitData";

	private String resContent;
	private String handlerURI;

	public ShowResourceListRenderer() {
	}

	public String getContent(List<String> resources) {
		StringBuilder sb = new StringBuilder();
		sb.append("<form method=\"post\" action=\"reslist.page\">");
		sb.append("<table>");
		int c = 0;
		for (String r : resources) {
			sb.append("<tr>");
			sb.append("<td>");
			sb.append("<a href=\"show" +r+"\">"+r + "</a>");
			sb.append("</td>");
			sb.append("<td>");
			sb.append("<input type=\"checkbox\" name="+"\"val"+ c++ + "\" value="+r+">");
			sb.append("</td>");
			sb.append("</tr>");
		}
		sb.append("<tr>");
		sb.append("<td>");
		sb.append("</td>");
		sb.append("<td>");
		sb.append("<input type=\"submit\" value=\"remove checked\"");
		sb.append("</td>");
		sb.append("</td>");
		sb.append("</tr>");
		sb.append("</table>");		
		sb.append("<br>");
		sb.append("</form>");
		return sb.toString();
	}

}
